/* To generate data randomly */

#include "data.h"

int init( data &md ) // only by &md can actual parameters be changed.
{

//	srand( (unsigned)time( NULL ) );

	int i,j;

	/*
	cout << "No. of jobs: " << endl;
	for ( i = 0; i < md.getnbJobs(); i ++ ) 
		cout << md.getJobs( i ) << " ";
	cout << endl;

	cout << "Jobs processing times: " << endl;
	*/

	for ( i = 0; i < md.getnbJobs(); i++) {
	//	cout << i << " " ;
		for ( j = 0; j < md.getnbStages(); j++){
			md.setPtimes(i,j, int(float(pmax - pmin) * rand() / RAND_MAX + pmin));
	//		cout << md.getPtimes( i,j ) << " " ;
	//		if ( j == md.getnbStages() - 1)
	//			cout << endl;		
		}
	}
/*
	md.setPtimes(0,0, 20);
	md.setPtimes(0,1, 24);
	md.setPtimes(0,2, 21);
	md.setPtimes(1,0, 10);
	md.setPtimes(1,1, 13);
	md.setPtimes(1,2, 11);
	md.setPtimes(2,0, 17);
	md.setPtimes(2,1, 20);
	md.setPtimes(2,2, 16);
*/




	return 0;
}